import request from '@/utils/request'
/**
 * (WipDefective)表实体类
 *
 * @author makejava
 * @since 2025-01-11 14:23:22
 */

export const entityPut={
    id: null,  //ID
    partNo: null,  //零件编号
    productSerialNo: null,  //产品流转号
    materialNo: null,  //材料炉号
    registrationTime: null,  //不良上报时间
    processNo: null,  //不良上报工序号
    processName: null,  //不良上报工序名称
    startPosition: null,  //不良上报位置
    startBy: null,  //不良上报工号
    unQuantity: null,  //不良品数量
    scrapNum: null,  //报废数量
    judgeTime: null,  //判定时间
    reworkTime: null,  //返工派发时间
    wipPlanSalesId: null,  //计划ID
    wipTraceTaskId: null,  //任务ID
    createTime: null,  //创建时间
    createBy: null,  //创建人
    updateTime: null,  //更新时间
    updateBy: null,  //更新人
    rework: null,  //返工数量
}
export const entityPo={
    id: null,  //ID
    partNo: null,  //零件编号
    productSerialNo: null,  //产品流转号
    materialNo: null,  //材料炉号
    registrationTime: null,  //不良上报时间
    processNo: null,  //不良上报工序号
    processName: null,  //不良上报工序名称
    startPosition: null,  //不良上报位置
    startBy: null,  //不良上报工号
    unQuantity: null,  //不良品数量
    scrapNum: null,  //报废数量
    judgeTime: null,  //判定时间
    reworkTime: null,  //返工派发时间
    wipPlanSalesId: null,  //计划ID
    wipTraceTaskId: null,  //任务ID
    createTime: null,  //创建时间
    createBy: null,  //创建人
    updateTime: null,  //更新时间
    updateBy: null,  //更新人
    rework: null,  //返工数量
}
export const tableList =[
    {
        type: "selection",
        prop: "id",
        header_align: "left",
        align: "left",
        fixed: "left",
        width: 40,
        min_width: 40,
        sortable: true,
        resizable: true,
        show_overflow_tooltip: true,
        show: true
    },
    {
        type: "default",
        label: "零件编号",
        prop: "partNo",
        header_align: "left",
        align: "left",
        fixed: false,
        width: 180,
        min_width: 180,
        sortable: "custom",
        resizable: true,
        show_overflow_tooltip: true,
        show: true,
        search: "Input"
    },
    {
        type: "default",
        label: "产品流转号",
        prop: "productSerialNo",
        header_align: "left",
        align: "left",
        fixed: false,
        width: 180,
        min_width: 180,
        sortable: "custom",
        resizable: true,
        show_overflow_tooltip: true,
        show: true,
        search: "Input"
    },
    {
        type: "default",
        label: "材料炉号",
        prop: "materialNo",
        header_align: "left",
        align: "left",
        fixed: false,
        width: 180,
        min_width: 180,
        sortable: "custom",
        resizable: true,
        show_overflow_tooltip: true,
        show: true,
        search: "Input"
    },
    {
        type: "default",
        label: "不良上报时间",
        prop: "registrationTime",
        header_align: "left",
        align: "left",
        fixed: false,
        width: 180,
        min_width: 180,
        sortable: "custom",
        resizable: true,
        show_overflow_tooltip: true,
        show: true,
        search: "Input"
    },
    {
        type: "default",
        label: "不良上报工序号",
        prop: "processNo",
        header_align: "left",
        align: "left",
        fixed: false,
        width: 180,
        min_width: 180,
        sortable: "custom",
        resizable: true,
        show_overflow_tooltip: true,
        show: true,
        search: "Input"
    },
    {
        type: "default",
        label: "不良上报工序名称",
        prop: "processName",
        header_align: "left",
        align: "left",
        fixed: false,
        width: 180,
        min_width: 180,
        sortable: "custom",
        resizable: true,
        show_overflow_tooltip: true,
        show: true,
        search: "Input"
    },
    {
        type: "default",
        label: "不良上报位置",
        prop: "startPosition",
        header_align: "left",
        align: "left",
        fixed: false,
        width: 180,
        min_width: 180,
        sortable: "custom",
        resizable: true,
        show_overflow_tooltip: true,
        show: true,
        search: "Input"
    },
    {
        type: "default",
        label: "不良上报工号",
        prop: "startBy",
        header_align: "left",
        align: "left",
        fixed: false,
        width: 180,
        min_width: 180,
        sortable: "custom",
        resizable: true,
        show_overflow_tooltip: true,
        show: true,
        search: "Input"
    },
    {
        type: "default",
        label: "不良品数量",
        prop: "unQuantity",
        header_align: "left",
        align: "left",
        fixed: false,
        width: 180,
        min_width: 180,
        sortable: "custom",
        resizable: true,
        show_overflow_tooltip: true,
        show: true,
        search: "Input"
    },
    {
        type: "default",
        label: "报废数量",
        prop: "scrapNum",
        header_align: "left",
        align: "left",
        fixed: false,
        width: 180,
        min_width: 180,
        sortable: "custom",
        resizable: true,
        show_overflow_tooltip: true,
        show: true,
        search: "Input"
    },
    {
        type: "default",
        label: "判定时间",
        prop: "judgeTime",
        header_align: "left",
        align: "left",
        fixed: false,
        width: 180,
        min_width: 180,
        sortable: "custom",
        resizable: true,
        show_overflow_tooltip: true,
        show: true,
        search: "Input"
    },
    {
        type: "default",
        label: "返工派发时间",
        prop: "reworkTime",
        header_align: "left",
        align: "left",
        fixed: false,
        width: 180,
        min_width: 180,
        sortable: "custom",
        resizable: true,
        show_overflow_tooltip: true,
        show: true,
        search: "Input"
    },
    {
        type: "default",
        label: "返工数量",
        prop: "rework",
        header_align: "left",
        align: "left",
        fixed: false,
        width: 180,
        min_width: 180,
        sortable: "custom",
        resizable: true,
        show_overflow_tooltip: true,
        show: true,
        search: "Input"
    },
    {
        type: "default",
        label: "计划ID",
        prop: "wipPlanSalesId",
        header_align: "left",
        align: "left",
        fixed: false,
        width: 180,
        min_width: 180,
        sortable: "custom",
        resizable: true,
        show_overflow_tooltip: true,
        show: true,
        search: "Input"
    },
    {
        type: "default",
        label: "任务ID",
        prop: "wipTraceTaskId",
        header_align: "left",
        align: "left",
        fixed: false,
        width: 180,
        min_width: 180,
        sortable: "custom",
        resizable: true,
        show_overflow_tooltip: true,
        show: true,
        search: "Input"
    },
    {
        type: "default",
        label: "创建时间",
        prop: "createTime",
        header_align: "left",
        align: "left",
        fixed: false,
        width: 180,
        min_width: 180,
        sortable: "custom",
        resizable: true,
        show_overflow_tooltip: true,
        show: true,
        search: "Input"
    },
    {
        type: "default",
        label: "创建人",
        prop: "createBy",
        header_align: "left",
        align: "left",
        fixed: false,
        width: 180,
        min_width: 180,
        sortable: "custom",
        resizable: true,
        show_overflow_tooltip: true,
        show: true,
        search: "Input"
    },
    {
        type: "default",
        label: "更新时间",
        prop: "updateTime",
        header_align: "left",
        align: "left",
        fixed: false,
        width: 180,
        min_width: 180,
        sortable: "custom",
        resizable: true,
        show_overflow_tooltip: true,
        show: true,
        search: "Input"
    },
    {
        type: "default",
        label: "更新人",
        prop: "updateBy",
        header_align: "left",
        align: "left",
        fixed: false,
        width: 180,
        min_width: 180,
        sortable: "custom",
        resizable: true,
        show_overflow_tooltip: true,
        show: true,
        search: "Input"
    },
]
export const editList =[
    {
        show: false,
        type: "hidden",
        label: "id",
        key: "id",
        span: 24
    },
    {
        show: true,
        type: "Input",
        label: "零件编号",
        key: "partNo",
        span: 12,
        data:{}
    },
    {
        show: true,
        type: "Input",
        label: "产品流转号",
        key: "productSerialNo",
        span: 12,
        data:{}
    },
    {
        show: true,
        type: "Input",
        label: "材料炉号",
        key: "materialNo",
        span: 12,
        data:{}
    },
    {
        show: true,
        type: "Input",
        label: "不良上报时间",
        key: "registrationTime",
        span: 12,
        data:{}
    },
    {
        show: true,
        type: "Input",
        label: "不良上报工序号",
        key: "processNo",
        span: 12,
        data:{}
    },
    {
        show: true,
        type: "Input",
        label: "不良上报工序名称",
        key: "processName",
        span: 12,
        data:{}
    },
    {
        show: true,
        type: "Input",
        label: "不良上报位置",
        key: "startPosition",
        span: 12,
        data:{}
    },
    {
        show: true,
        type: "Input",
        label: "不良上报工号",
        key: "startBy",
        span: 12,
        data:{}
    },
    {
        show: true,
        type: "Input",
        label: "不良品数量",
        key: "unQuantity",
        span: 12,
        data:{}
    },
    {
        show: true,
        type: "Input",
        label: "报废数量",
        key: "scrapNum",
        span: 12,
        data:{}
    },
    {
        show: true,
        type: "Input",
        label: "判定时间",
        key: "judgeTime",
        span: 12,
        data:{}
    },
    {
        show: true,
        type: "Input",
        label: "返工派发时间",
        key: "reworkTime",
        span: 12,
        data:{}
    },
    {
        show: true,
        type: "Input",
        label: "计划ID",
        key: "wipPlanSalesId",
        span: 12,
        data:{}
    },
    {
        show: true,
        type: "Input",
        label: "任务ID",
        key: "wipTraceTaskId",
        span: 12,
        data:{}
    },
    {
        show: true,
        type: "Input",
        label: "创建时间",
        key: "createTime",
        span: 12,
        data:{}
    },
    {
        show: true,
        type: "Input",
        label: "创建人",
        key: "createBy",
        span: 12,
        data:{}
    },
    {
        show: true,
        type: "Input",
        label: "更新时间",
        key: "updateTime",
        span: 12,
        data:{}
    },
    {
        show: true,
        type: "Input",
        label: "更新人",
        key: "updateBy",
        span: 12,
        data:{}
    },
    {
        show: true,
        type: "Input",
        label: "返工数量",
        key: "rework",
        span: 12,
        data:{}
    },
]
export const PageMix={
    records:[],
    total: 0,
    size: 10,
    current: 1,
    orderItem: "update_time",
    ascending: false,
    queryEntity: {
        id: null,  //ID
        partNo: null,  //零件编号
        productSerialNo: null,  //产品流转号
        materialNo: null,  //材料炉号
        registrationTime: null,  //不良上报时间
        processNo: null,  //不良上报工序号
        processName: null,  //不良上报工序名称
        startPosition: null,  //不良上报位置
        startBy: null,  //不良上报工号
        unQuantity: null,  //不良品数量
        scrapNum: null,  //报废数量
        judgeTime: null,  //判定时间
        reworkTime: null,  //返工派发时间
        wipPlanSalesId: null,  //计划ID
        wipTraceTaskId: null,  //任务ID
        delFlag: null,  //逻辑删除标记
        createTime: null,  //创建时间
        createBy: null,  //创建人
        updateTime: null,  //更新时间
        updateBy: null,  //更新人
        rework: null,  //返工数量
    },
    queryJSON: {
        id: "id",  //ID
        partNo: "partNo",  //零件编号
        productSerialNo: "productSerialNo",  //产品流转号
        materialNo: "materialNo",  //材料炉号
        registrationTime: "registrationTime",  //不良上报时间
        processNo: "processNo",  //不良上报工序号
        processName: "processName",  //不良上报工序名称
        startPosition: "startPosition",  //不良上报位置
        startBy: "startBy",  //不良上报工号
        unQuantity: "unQuantity",  //不良品数量
        scrapNum: "scrapNum",  //报废数量
        judgeTime: "judgeTime",  //判定时间
        reworkTime: "reworkTime",  //返工派发时间
        wipPlanSalesId: "wipPlanSalesId",  //计划ID
        wipTraceTaskId: "wipTraceTaskId",  //任务ID
        delFlag: "delFlag",  //逻辑删除标记
        createTime: "createTime",  //创建时间
        createBy: "createBy",  //创建人
        updateTime: "updateTime",  //更新时间
        updateBy: "updateBy",  //更新人
        rework: "rework",  //返工数量
        ok: "ok",  //返工数量
        okTime: "okTime",  //返工数量
    },
    likeSomeWord: null,
    betweenItem: "updateTime",
    betweenStart: null,
    betweenEnd: null
}

export function list() {
    return request({
        url: "/wip/wipDefective",
        method: 'get'
    })
}
export function getById(id) {
    return request({
        url: "/wip/wipDefective/" + id,
        method: 'get'
    })
}
export function findList(entityQuery) {
    return request({
        url: "/wip/wipDefective/findList",
        method: 'post',
        data: entityQuery
    })
}
export function findOne(entityQuery) {
    return request({
        url: "/wip/wipDefective/findOne",
        method: 'post',
        data: entityQuery
    })
}
export function pageMix(pageMix) {
    return request({
        url: "/wip/wipDefective/pageMix",
        method: 'post',
        data: pageMix
    })
}
export function pageMixJoin(pageMix) {
    return request({
        url: "/wip/wipDefective/pageMixJoin",
        method: 'post',
        data: pageMix
    })
}
export function insert(entityPut) {
    entityPut.id=null;
    return request({
        url: "/wip/wipDefective",
        method: 'put',
        data: entityPut
    })
}
export function update(entityPut) {
    return request({
        url: "/wip/wipDefective/update",
        method: 'put',
        data: entityPut
    })
}
export function del(ids) {
    return request({
        url: "/wip/wipDefective/" + ids,
        method: 'delete'
    })
}
export function deleteDeep(ids) {
    return request({
        url: "/wip/wipDefective/deep/" + ids,
        method: 'delete'
    })
}

export function doScrap(id,doScrap) {
    return request({
        url: "/wip/wipDefective/doScrap/" + id,
        method: 'put',
        params: {
            "doScrap":doScrap
        }
    })
}

export function rework(id,rework,processID,rfidCode) {
    return request({
        url: "/wip/wipDefective/rework/" + id,
        method: 'put',
        params: {
            "rework":rework,
            "processID":processID,
            "rfidCode":rfidCode
        }
    })
}
export function ok(id,rework,processID,rfidCode) {
    return request({
        url: "/wip/wipDefective/ok/" + id,
        method: 'put',
        params: {
            "rework":rework,
            "processID":processID,
            "rfidCode":rfidCode
        }
    })
}
